package ReviewTest;


import java.util.Random;
import java.util.Scanner;

public class try11 {
    public static void main(String[] args) {
        int[] arr = new int[5];
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(1, 100);
            System.out.print(arr[i] + " ");
        }
        System.out.println();
        System.out.println("请输入一个2-5之间的数字");
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] % num == 0) {
                System.out.print(arr[i] + " ");
            }
        }
    }
}
